<?php

declare(strict_types=1);

namespace Plugin\Attractions\Commerce\Model\Commerce_contract;

use Hyperf\Database\Model\SoftDeletes;
use Hyperf\DbConnection\Model\Model;

/**
 * @property int $id 合同编号
 * @property int $merchant_id 商户ID
 * @property string $contract_title 合同标题
 * @property string $party_a 甲方
 * @property string $party_b 乙方
 * @property string $contract_amount 合同金额
 * @property string $sign_date 签订日期
 * @property string $effective_date 生效日期
 * @property string $expiry_date 到期日期
 * @property string $contract_file 合同文件路径
 * @property array $attachment_files 附件文件路径（JSON格式）
 * @property int $payment_method 付款方式1-银行转账,2-微信支付,3-支付宝支付,4-现金,5-其他付款方式
 * @property string $remark 合同备注
 * @property \Carbon\Carbon $created_at 
 * @property \Carbon\Carbon $updated_at 
 * @property string $deleted_at 
 */
class CommerceContract extends Model
{
    use SoftDeletes;
    public bool $incrementing = false;
    protected string $primaryKey = 'id';
    /**
     * The table associated with the model.
     */
    protected ?string $table = 'commerce_contract';

    /**
     * The attributes that are mass assignable.
     */
    protected array $fillable = ['id', 'merchant_id', 'contract_title', 'party_a', 'party_b', 'contract_amount', 'sign_date', 'effective_date', 'expiry_date', 'contract_file', 'attachment_files', 'payment_method', 'remark', 'created_at', 'updated_at', 'deleted_at'];

    /**
     * The attributes that should be cast to native types.
     */
    protected array $casts = ['id' => 'integer', 'merchant_id' => 'integer', 'contract_amount' => 'decimal:2', 'attachment_files' => 'array', 'payment_method' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];
}
